Carbon


WindowPathSelect

Header: MacWindows.h Carbon status: Supported

Displays a window path pop-up menu.

OSStatus WindowPathSelect (
    WindowRef window, 
    MenuHandle menu, 
    SInt32 *outMenuResult
);
window

A pointer to the window for which a window path pop-up menu is to be displayed.

menu

A handle to a menu to be displayed for the specified window or NULL. If you pass NULL in this parameter, the Window Manager provides a default menu and sends a Reveal Object Apple event to the Finder if a menu item is selected. Note that in order to pass NULL, there must be a file currently associated with the window. If you pass in a menu handle, this menu supersedes the default window path pop-up menu, and the WindowPathSelect function temporarily inserts the specified menu into the current pop-up menu list. There does not have to be a file currently associated with the window if you pass in your own menu handle.

outMenuResult

A pointer to a value that, on return, contains the menu and menu item the user chose. The high-order word of the value produced contains the menu ID, and the low-order word contains the item number of the menu item. If the user does not select a menu item, 0 is produced in the high-order word, and the low-order word is undefined. For file menus that have not been overridden, 0 is always produced in this parameter. Pass NULL in this parameter if you do not want this information.

function result

A result code.

DISCUSSION

Your application should call the WindowPathSelect function when it detects a Command-click in the title of a window, that is, when the function IsWindowPathSelectClick returns a value of true. Calling WindowPathSelect causes the Window Manager to display a window path pop-up menu for your window.

SPECIAL CONSIDERATIONS

Note that when WindowPathSelect returns noErr, your application should ensure that the window opened by the Finder’s Reveal Object Apple event handler is visible to the user. To do this, your application should call the Process Manager function SetFrontProcess with the Finder’s process serial number.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)